﻿#include <iostream>

using namespace std;

int main() {
	int a[] = { 1,2,3,4,5,6,7,8 };

	int a_size = sizeof(a) / sizeof(a[0]);

	int temp;

	for (int i = 0; i < a_size / 2; i++) {
		temp = a[i];
		a[i] = a[a_size - 1 - i];
		a[a_size - 1 - i] = temp;
	}

	for (int i = 0; i < a_size; i++) {
		cout << "a[" << i << "]=" << a[i] << endl;
	}

	cin.get();
}